package visiopuce.action;

import java.util.Calendar;
import java.util.Date;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;

import visiopuce.ICommandIds;
import visiopuce.service.PrescriptionServiceImpl;

public class RecupererPrescriptionPDFAction extends Action {

	public RecupererPrescriptionPDFAction(String text) {
		super(text);

		// The id is used to refer to the action in a menu or toolbar
		setId(ICommandIds.CMD_RECUPERER_PRESCRIPTION_PDF);
		// Associate the action with a pre-defined command, to allow key
		// bindings.
		setActionDefinitionId(ICommandIds.CMD_RECUPERER_PRESCRIPTION_PDF);
		setText("Recupérer les prescriptions PDF");
		setImageDescriptor(visiopuce.Activator.getImageDescriptor("/icons/download.png"));
	}

	public void run() {
//		Calendar calendar=Calendar.getInstance();
//		calendar.add(Calendar.DATE, -7);
//		
//		String resultat = PrescriptionServiceImpl.getInstance().parseTxt(calendar.getTime(), new Date());
//		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Traitement terminé", "Enregistrement terminé : "+resultat);
	}
}